package
{
	import com.GameModel;
	import com.LLKGame;
	import com.config.FrameWorkStates;
	import com.core.BasicScreen;
	import com.core.GameFrameWork;
	import com.event.GameEvent;
	[SWF(width=640,height=480)]
	public class Main extends GameFrameWork
	{
		public function Main()
		{
			super();
			init();
		}
		override public function init( ):void {
			game = new LLKGame;
			setApplicationBackGround(640,960,true,0,new Bg);
			titleScreen = new BasicScreen;
			titleScreen.createTitleView(title);
			instructionsScreen = new BasicScreen;
			instructionsScreen.createInstructionView(instruction);
			levelSelectScreen = new BasicScreen;
			levelSelectScreen.createLevelSelect(levelSelect);
			levelSelectScreen.showLevel(1);
			levelSelectScreen.addEventListener(GameEvent.GAME_LEVEL_SELECT,onGameLevelSelect);
			levelInScreen = new BasicScreen;
			levelInScreen.createLevelIn(levelIn);
			switchSystemState(FrameWorkStates.STATE_SYSTEM_TITLE);
			waitTime = 30;
			frameRate = 30;
			startTimer();
		}
		private function onGameLevelSelect(e:GameEvent):void{
			GameModel.getInstance().level = e.level;
		}
	}
}